package com.llb666.e.shop.api.vo;

import com.llb666.e.shop.domain.entity.bo.ShopCartBo;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 购物车Vo
 * @author llb666
 */
@Data
public class ShopCartVo {

    /**
     * 商品Id
     */
    private String itemId;
    /**
     * 商品图片
     */
    private String itemImgUrl;
    /**
     * 商品名称
     */
    private String itemName;
    /**
     * 商品规格Id
     */
    private String specId;
    /**
     * 规格名称
     */
    private String specName;
    /**
     * 添加数量
     */
    private Integer buyCounts;
    /**
     * 优惠价
     */
    private String priceDiscount;
    /**
     * 原价
     */
    private String priceNormal;


    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {
        ShopCartVo.Converter INSTANCE = Mappers.getMapper(ShopCartVo.Converter.class);

        ShopCartVo bo2Vo(ShopCartBo activity);

        List<ShopCartVo> bo2VoList(List<ShopCartBo> shopCartBoList);
    }
}
